//创建仓位
import React from 'react';
import { Button } from 'antd';
import CommonModal from '@/components/CommonModal';

const AdvanceModal = ({ advanceVisible, handleCancel, handleOk }) => {
  //提交
  const onOk = () => {
    handleOk();
  };

  //取消
  const onCancel = () => {
    handleCancel();
  };

  return (
    <CommonModal
      title="提前出账"
      visible={advanceVisible}
      footer={[
        <Button onClick={onCancel} key="cancel">
          取消
        </Button>,
        <Button onClick={onOk} key="confirm" type="primary">
          确定
        </Button>,
      ]}
      onCancel={onCancel}
      width={400}
    >
      <div className="modalBox">确定要提前出账吗?</div>
    </CommonModal>
  );
};

export default React.memo(AdvanceModal, (prev, next) => {
  if (prev.advanceVisible !== next.advanceVisible) {
    return false;
  }
  return true;
});
